//
//  OrderSectionFooter.m
//  PPDL
//
//  Created by 王洋 on 2019/8/12.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "OrderSectionFooter.h"

@interface OrderSectionFooter ()

//@property (nonatomic, strong) UIView   *lineView;

@property (nonatomic, strong) UILabel  *statisticsLab;
//
//@property (nonatomic, strong) UIButton *actionBtn;

@end

@implementation OrderSectionFooter

- (instancetype)initWithReuseIdentifier:(nullable NSString *)reuseIdentifier{
    
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        self.contentView.backgroundColor = [UIColor whiteColor];
        [self layout];
    }
    return self;
}

- (void)fillFooterWithModel:(OrderListModel *)model {
    
    self.statisticsLab.text = [NSString stringWithFormat:@"共计%@元",[Utilities changeDoubleToString:model.itemGoodsTotalPrice]];
    
//    [self.actionBtn setTitle:@"去支付" forState:UIControlStateNormal];
}

- (void)layout {
    
//    [self addSubview:self.lineView];
    [self addSubview:self.statisticsLab];
//    [self addSubview:self.actionBtn];
    
//    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.right.mas_equalTo(0);
//        make.height.mas_equalTo(0.5);
//        make.centerY.mas_equalTo(0);
//    }];
    
    [self.statisticsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.centerY.mas_equalTo(0);
    }];
    
//    [self.actionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.mas_equalTo(self.lineView).offset(10);
//        make.right.mas_equalTo(-13);
//        make.width.mas_equalTo(70);
//        make.height.mas_equalTo(26);
//    }];
    
}

//- (void)layoutSubviews {
//    [super layoutSubviews];
//    [self.actionBtn pp_clipCorners:UIRectCornerAllCorners radius:13 border:1 color:PP_Default_Color_Red_FF3737];
//
//}

//- (UIButton *)actionBtn {
//    if (!_actionBtn) {
//        _actionBtn = [UIButton buttonWithType:UIButtonTypeCustom];
//        [_actionBtn setTitleColor:PP_Default_Color_Red_FF3737 forState:UIControlStateNormal];
//        _actionBtn.titleLabel.font = [UIFont systemFontOfSize:15];
//        [_actionBtn addTarget:self action:@selector(btnOnClicked) forControlEvents:UIControlEventTouchUpInside];
//
//    }
//    return _actionBtn;
//}

//- (void)btnOnClicked {
//
//    if (self.clickOrderFooterAction) {
//        self.clickOrderFooterAction(ETTOrderDetailType_UnPay);
//    }
//}

//- (UIView *)lineView {
//    if (!_lineView) {
//        _lineView = [[UIView alloc] init];
//        _lineView.backgroundColor = UIColorHex(0xd9d9d9);
//
//    }
//    return _lineView;
//}
//
- (UILabel *)statisticsLab {
    if (!_statisticsLab) {
        _statisticsLab = [[UILabel alloc] init];
        _statisticsLab.font = [UIFont systemFontOfSize:15];
        _statisticsLab.textColor = UIColorHex(0x333333);
    }
    return _statisticsLab;
}

@end
